<%--
  Created by IntelliJ IDEA.
  User: maliangcheng
  Date: 2020/8/15
  Time: 23:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@include file="head.jsp"%>
<html>
<head>
    <title>addGoods</title>
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="/resource/layui/css/layui.css" media="all">
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.js"></script>
</head>
<body>
<div style="padding: 20px; background-color: #F2F2F2;">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">
                    填写商品信息
                </div>
                <div class="layui-card-body">
                    <form class="layui-form" action="${pageContext.request.contextPath}/goods/addGoods">
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 100px;color: #606266">商品分类</label>
                            <div class="layui-input-block">
                                <input type="text" name="goodsType" autocomplete="off" placeholder="请输入商品分类" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 100px;color: #606266">商品名称</label>
                            <div class="layui-input-block">
                                <input type="text" name="goodsName" placeholder="请输入商品名称" autocomplete="off" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label" style="width: 100px;color: #606266">商品厂家</label>
                                <div class="layui-input-block">
                                    <input type="text" name="goodsManufacturer" placeholder="请输入商品厂家" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label" style="width: 100px;color: #606266">商品货号</label>
                                <div class="layui-input-block">
                                    <input type="text" name="goodsId" placeholder="请输入商品货号" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label" style="width: 100px;color: #606266">单价</label>
                                <div class="layui-input-block">
                                    <input type="text" name="goodsUnit" placeholder="请输入单价" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 100px;color: #606266">库存量</label>
                            <div class="layui-input-block">
                                <input type="text" name="goodsInventory" placeholder="请输入库存量" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button type="submit" class="layui-btn" lay-submit="" >立即提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>




<script src="/resource/layui/layui.js" charset="utf-8"></script>
<script src="../js/addGoods.js"></script>
<%--<script>--%>
<%--    layui.use(['form', 'layedit', 'laydate'], function(){--%>
<%--        var form = layui.form--%>
<%--            ,layer = layui.layer--%>
<%--            ,layedit = layui.layedit--%>
<%--            ,laydate = layui.laydate;--%>

<%--        //日期--%>
<%--        laydate.render({--%>
<%--            elem: '#date'--%>
<%--        });--%>
<%--        laydate.render({--%>
<%--            elem: '#date1'--%>
<%--        });--%>

<%--        //创建一个编辑器--%>
<%--        var editIndex = layedit.build('LAY_demo_editor');--%>

<%--        //自定义验证规则--%>
<%--        form.verify({--%>
<%--            title: function(value){--%>
<%--                if(value.length < 5){--%>
<%--                    return '标题至少得5个字符啊';--%>
<%--                }--%>
<%--            }--%>
<%--            ,pass: [--%>
<%--                /^[\S]{6,12}$/--%>
<%--                ,'密码必须6到12位，且不能出现空格'--%>
<%--            ]--%>
<%--            ,content: function(value){--%>
<%--                layedit.sync(editIndex);--%>
<%--            }--%>
<%--        });--%>

<%--        //监听指定开关--%>
<%--        form.on('switch(switchTest)', function(data){--%>
<%--            layer.msg('开关checked：'+ (this.checked ? 'true' : 'false'), {--%>
<%--                offset: '6px'--%>
<%--            });--%>
<%--            layer.tips('温馨提示：请注意开关状态的文字可以随意定义，而不仅仅是ON|OFF', data.othis)--%>
<%--        });--%>

<%--        //监听提交--%>
<%--        form.on('submit(demo1)', function(data){--%>
<%--            layer.alert(JSON.stringify(data.field), {--%>
<%--                title: '最终的提交信息'--%>
<%--            })--%>
<%--            return false;--%>
<%--        });--%>

<%--        //表单赋值--%>
<%--        layui.$('#LAY-component-form-setval').on('click', function(){--%>
<%--            form.val('example', {--%>
<%--                "username": "贤心" // "name": "value"--%>
<%--                ,"password": "123456"--%>
<%--                ,"interest": 1--%>
<%--                ,"like[write]": true //复选框选中状态--%>
<%--                ,"close": true //开关状态--%>
<%--                ,"sex": "女"--%>
<%--                ,"desc": "我爱 layui"--%>
<%--            });--%>
<%--        });--%>

<%--        //表单取值--%>
<%--        layui.$('#LAY-component-form-getval').on('click', function(){--%>
<%--            var data = form.val('example');--%>
<%--            alert(JSON.stringify(data));--%>
<%--        });--%>

<%--    });--%>
<%--</script>--%>

</body>
</html>
